package leetcode.sword;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Sorter {


    public void qiuckSort(int[] nums, int start, int end){
        if(start>=end) return;
        int i = start, j = end, base = nums[start];
        while(i<j){
            while(i<j&&nums[j]>=base) j--;
            nums[i] = nums[j];
            while(i<j&&nums[i]<base) i++;
            nums[j] = nums[i];
        }
        //i=j
        nums[i] = base;
        qiuckSort(nums, start, i-1);
        qiuckSort(nums, i+1, end);

//        List a = new LinkedList<>();

        ArrayList<LinkedList<Integer>> total = new ArrayList<>();
        List<List<Integer>> a;
        a = (List) total;
    }


//    class Solution375 {
//        List<List<Integer>> total = new ArrayList();
//        public List<List<Integer>> levelOrder(TreeNode root) {
//            level(root,0);
//            return total;
//        }
//        public void level(TreeNode root,int k){
//            if(root != null){
//                if(total.size()<=k) total.add(new ArrayList());
//                total.get(k).add(root.val);
//                level(root.left,k+1);
//                level(root.right,k+1);
//            }
//        }
//    }



}
